package com.study.mall.basic;

public class Person implements Cloneable{
    public Integer age;
    public int[] arr = {1, 2};

    public Person(Integer age) {
        this.age = age;
    }

    @Override
    public Person clone() {
        try {
            //return (Person) super.clone();
            Person person = (Person) super.clone();
            person.arr = this.arr.clone(); //调用引用类型的clone方法
            return person;
        } catch (CloneNotSupportedException e) {
            throw new RuntimeException(e);
        }
    }
}


